{% include file="index.header.tpl.php" %}
{%include file="index.left.tpl.php"%}
 <!--左侧导航结束-->
      <style>
		@media only screen and (max-width: 760px),(min-device-width: 768px) and (max-device-width:1024px)  {
		#mytable, #mytable thead, #mytable tbody, #mytable th, #mytable td, #mytable tr { 
			display: block; 
		}
		#mytable thead tr { 
			position: absolute;
			top: -9999px;
			left: -9999px;
		}
		#mytable td { 
			border: none;
			border-bottom: 1px solid #eee; 
			position: relative;
			padding-left:34% !important; 
			padding-top:10px ;
		}
	    #mytable tr{ margin-bottom:20px;}
		#mytable td:before { 
			position: absolute;
			top:10px;
			left:8px;
			width: 45%; 
			padding-right:10px;
			white-space: nowrap;
		}
		    #mytable td:nth-of-type(1):before { content: "日期"; }
			#mytable td:nth-of-type(2):before { content: "星期"; }
			#mytable td:nth-of-type(3):before { content: "主要内容"; }
			#mytable td:nth-of-type(4):before { content: "负责部门"; }
			#mytable td:nth-of-type(5):before { content: "备注"; }
			#mytable td:nth-of-type(6):before { content: "操作"; }
        }		
	</style>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form name="form1" action="" method="get">	
                <div class="box-header with-border">
                    <span class="fa fa-table" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">学校日常工作布置</p>
					<a href="index.php?a=arrange.hourdayadd" class="btn btn-primary btn-sm" style="float:right; color:#fff;">新 增</a>
					<a href="index.php?a=arrange.workdayin" class="btn btn-warning btn-sm" style="float:right; color:#fff; margin-right:8px"> 导 出 </a>
                </div>
                <div class="box-body">
                     <div class="col-md-5 col-xs-12 form-group" style="padding:0;">
						  <label for="inputPassword3" class="col-sm-2 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500; ">
							   日期：
						  </label>
						  <div class="input-group col-md-4" style="float:left;">
							   <input type="text" class="form-control" value="{%$start_time%}" id="from" name="start_time">
							     <div class="input-group-addon">
									<i class="fa fa-calendar"></i>
								 </div>
						  </div>
						  <span style="float:left;">  ~  </span >
						  <div class="input-group col-md-4" style="float:left; margin-right:10px;">
							   <input type="text" class="form-control" value="{%$end_time%}" id="to" name="end_time">
							      <div class="input-group-addon">
									 <i class="fa fa-calendar"></i>
								 </div>
						  </div>
						  <input type="hidden" name="a" value="arrange.hourdaylist">
				    </div>
                     <button type="submit" class="btn btn-primary">搜 索</button>
               </form>
                    <div style="clear:both;"></div>
				  <h4 class="text-center">学校日常工作布置表</h4>
                     <table class="table table-bordered"  id="mytable">
                                <thead>
                                    <tr style="background-color:#a273ff;">
                                        <td>日期</td>
										<td>星期</td>
										<td>标题</td>
										<td>主要内容</td>
										<td>负责部门</td>
										<td>备注</td>
										<td width="120">操作</td>										
                                    </tr>	
                                </thead>
                                <tbody>
								{%foreach from=$hourday_lists key=key item=value%}
                                    <tr>
                                        <td>{%$value.start_time%}</td>
										<td>{%$value.week%}</td>
										<td><a href="index.php?a=arrange.hourdayinfo&arrange_id={%$value.arrange_id%}">{%$value.arrange_title%}</a>
											</td>
										<td>
										   {%$value.arrange_content%}
										</td>
										<td>
										{%foreach from=$value.department_name key=k item=v%}
										{%$v%}
										{%/foreach%}
										{%$value.arrange_rest%}
										</td>
										<td> {%$value.arrange_remark%}</td>
										 <td>
										      <a href="index.php?a=arrange.hourdayupdate&arrange_id={%$value.arrange_id%}" class="btn btn-warning btn-sm" title="修改"><i class="fa fa-edit (alias)"></i></a>
											  <a href="index.php?a=arrange.hourdaydel&arrange_id={%$value.arrange_id%}" class="btn btn-danger btn-sm" title="删除"><i class="fa fa-trash"></i></a>
										 </td>
                                    </tr>	
                                  {%/foreach%}	
                                	
                            </tbody>
                        </table>
				   </div><!--box-body -->

			   <div class="box-footer">
			   {%$page%}
			   </div>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
 {%include file="index.footer.tpl.php"%} 
 <script>
  $(function() {
    $( "#from" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
	  changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#to" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
  </script>